package com.csx.framework.springboot.sample.data;

import com.csx.framework.springboot.sample.data.transaction.TransactionManagerSample;
import com.csx.framework.springboot.sample.data.transaction.TransactionTemplateSample;
import com.csx.framework.springboot.sample.data.transaction.TransactionalAnnotationSample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * <p> what does this class do ? </p>
 * <p> How does it work ?</p>
 * <p> Why does it do this ?</p>
 *
 * @author cuisongxu
 * @date 2024/12/21 周六 13:35
 */
@SpringBootApplication
public class SpringBootDataSampleApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(SpringBootDataSampleApplication.class, args);
        TransactionManagerSample transactionManagerSample = applicationContext.getBean(TransactionManagerSample.class);
        TransactionTemplateSample transactionTemplateSample = applicationContext.getBean(TransactionTemplateSample.class);
        TransactionalAnnotationSample transactionalAnnotationSample = applicationContext.getBean(TransactionalAnnotationSample.class);

//        transactionManagerSample.testTransactionManager();
//        transactionTemplateSample.testTransactionTemplate();
        transactionalAnnotationSample.testTransactionalAnnotation();
        transactionalAnnotationSample.test1();

        System.out.println("end");
    }
}
